/*
 *  菜单表格列
 *
 * @Author:    zhoujk
 * @Date:      2022-05-12 19:46:11
 */
import { ref } from 'vue'
import { MENU_SOURCE_TYPE } from '/@/constants/dict'
import { selectDictLabel } from '/@/utils/common'
export const columns = ref([
  {
    title: '名称',
    dataIndex: 'name',
    key: 'ID',
    width: 200,
  },
  {
    title: '类型',
    dataIndex: 'type',
    width: 80,
  },
  {
    title: '来源',
    dataIndex: 'sourceType',
    customRender: ({ text }) => {
      return selectDictLabel(MENU_SOURCE_TYPE, text)
    },
    width: 80,
  },
  {
    title: '图标',
    dataIndex: 'icon',
    width: 50,
  },
  {
    title: '路径',
    dataIndex: 'path',
    ellipsis: true,
  },
  {
    title: '组件',
    dataIndex: 'component',
    ellipsis: false,
  },
  {
    title: '权限',
    dataIndex: 'permission',
    ellipsis: true,
  },
  {
    title: '状态',
    dataIndex: 'status',
    width: 60,
  },
  {
    title: '顺序',
    dataIndex: 'num',
    width: 80,
  },
  {
    title: '操作',
    dataIndex: 'operate',
    fixed: 'right',
    width: 100,
  },
])
